import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.DriverManager;
public class text {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Class.forName("com.mysql.jdbc.Driver");
        String url = "jdbc:mysql://localhost:3306/@localhost";
        String user = "root";
        String password = "123456";
        java.sql.Connection myConnection = DriverManager.getConnection(url, user, password);
        Statement mystatement = myConnection.createStatement();
        ResultSet rs = mystatement.executeQuery("  SELECT * FROM @localhost.cutomer");
        while (rs.next()) {
            String fn = rs.getString("f_name");
            String fp = rs.getString("f_price");
            System.out.println(fn + "  " + fp);
        }
        if (mystatement != null) {
            mystatement.close();
            mystatement = null;
        }
        if (myConnection != null) {
            myConnection.close();
            myConnection = null;
        }
    }
}